package lgs.hm.homeWork;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class Security {
	
	@Pointcut("execution(* lgs.hm.homeWork.XiaoMing.*(..))")
	public void haha() {}
	
	@Around("lgs.hm.homeWork.Security.haha()")
	public void search(ProceedingJoinPoint pjp) {
		System.out.println("保安：--你没有携带危险物品，进去吧--");
		
		try {
			pjp.proceed();
		} catch (Throwable e) {
			e.printStackTrace();
			System.out.println("保安：快报警，集合消灭恐龙");
		}
	}

}
